#! /bin/bash
FP_PARA=/opt/ml/input/data/cfg/train-args.json
data=$(cat $FP_PARA | jq -r '.FP_DATA')
yolo=$(cat $FP_PARA | jq -r '.FP_YOLO')
weight=$(cat $FP_PARA | jq -r '.FP_WEIGHT')
hyp=$(cat $FP_PARA | jq -r '.FP_HYP')
img=$(cat $FP_PARA | jq -r '.IMG_SIZE')
batch=$(cat $FP_PARA | jq -r '.BATCH')
epochs=$(cat $FP_PARA | jq -r '.EPOCHS')
name=$(cat $FP_PARA | jq -r '.NAME')
echo $data
echo $yolo
echo $weight
tensorboard --logdir runs/train --bind_all &
python /opt/yolov5/train.py --img $img --batch $batch --hyp $hyp --epochs $epochs --data $data \
--cfg $yolo --weights $weight --name $name
cp -r /opt/yolov5/runs/train/$name /opt/ml/model/
